package com.ikapp.jetpackcomposeuidemo.weiget

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.SliderDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview

/**
 *  ANDROID STUDIO - VERSION 123
 *  createTime: 2023/11/23 23:05
 *  Author: Ikun
 *  email: jikunwei41@gmail.com
 **/

@Composable
@Preview
fun TestShowSlider() {
    Slider()
}

@Composable
fun Slider(
    modifier: Modifier = Modifier
) {
    var progress by remember { mutableStateOf(0f) }

    Column {

        Text(text = progress.toInt().toString())

        androidx.compose.material3.Slider(
            value = progress,
            onValueChange = {
                progress = it
            },
            colors = SliderDefaults.colors(
                thumbColor = Color.White,
                activeTrackColor = Color(0xFF0079D3)
            )
        )
    }

}